package com.hyl.entity;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;
import java.util.Date;

/**
 * @Description 用户
 * @Author hyl
 * @Date 2023/3/31 10:43
 **/
@Data
public class SysUser {
    private Integer	id;
    @NotNull(message = "不允许为空")
    @Length(min = 4,max = 8)
	private String	account;
	private String	realName;
	private String	password;
	private Integer	sex;
	@Past
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@JSONField(format = "yyyy-MM-dd")
	private Date birthday;
//	private Integer		phone;
	private String 	address;
	private Integer	roleId;
	private Integer	createdUserId;
	private Date createdTime;
	private Integer	updatedUserId;
	private Date	updatedTime;
	private String 	idPicPath;
	private String 	workPicPath;



	//只有一种角色==》多对一 ==》【多个用户 对 一个角色】

	private SysRole sysRole;



}
